/**
	* Copyright (c) minuteproject, minuteproject@gmail.com
	* All rights reserved.
	* 
	* Licensed under the Apache License, Version 2.0 (the "License")
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	* 
	* http://www.apache.org/licenses/LICENSE-2.0
	* 
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
	* 
	* More information on minuteproject:
	* twitter @minuteproject
	* wiki http://minuteproject.wikispaces.com 
	* blog http://minuteproject.blogspot.net
	* 
*/
/**
	* template reference : 
	* - name : OpenxavaDomainObjectUML
	* - file name : DomainObjectUMLJPAAnnotationOXAnnotationV4.vm
*/
package sistema_oficial.sistema_oficial.domain.sistemaoficial;

//MP-MANAGED-ADDED-AREA-BEGINNING @import@
//MP-MANAGED-ADDED-AREA-ENDING @import@
import java.sql.*;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Set;
import java.util.HashSet;

import javax.persistence.*;
import org.openxava.annotations.*;

import sistema_oficial.sistema_oficial.domain.sistemaoficial.Comprobante;
import sistema_oficial.sistema_oficial.domain.sistemaoficial.FacturaVenta;

/**
 *
 * <p>Title: CobroFactura</p>
 *
 * <p>Description: Domain Object describing a CobroFactura entity</p>
 *
 */
@Entity (name="CobroFactura")
@Table (name="cobro_factura")
@Views({
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @view-base-cobro_factura@
	@View(
		name="base",
		members=
        "" 	
        + "identificador  ; "
        + "comprobanteIdentificador  ; "
        + "facturaVentaIdentificador  ; "
		),
//MP-MANAGED-UPDATABLE-ENDING
	@View(
		name="Create", 
		extendsView="base"
	),
	@View(
		name="Update", 
		extendsView="base",
        members=
          "" 	
	),
	@View(extendsView="base",
        members=
          "" 	
	),
    @View(name="cobroFacturaDEFAULT_VIEW", 
	   members=
          " identificador ;" 	
	),
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @view-reference-cobro_factura@
    @View(name="reference", 
       extendsView="cobroFacturaDEFAULT_VIEW"
//MP-MANAGED-UPDATABLE-ENDING
    )
})

@Tabs({
@Tab(
properties=""
)
,
@Tab(
name = "CobroFacturaTabWithRef",
properties=""
)
})
//MP-MANAGED-ADDED-AREA-BEGINNING @class-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @class-annotation@
public class CobroFactura {

    @Hidden @Id @Column(name="identificador" )
    private Integer identificador; 


//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @parent-Comprobante-cobro_factura@
    @ManyToOne (fetch=FetchType.LAZY ,optional=false) //remove optional=false to aggragate but leads to a side effect when going directly to the entity: required check is not performed=> if no set DB check constraint is raised...
    @JoinColumn(name="comprobante_identificador", nullable=false,  unique=false  )
    @ReferenceView ("reference") 
    private Comprobante comprobanteIdentificador; 
    
//MP-MANAGED-UPDATABLE-ENDING
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @parent-FacturaVenta-cobro_factura@
    @ManyToOne (fetch=FetchType.LAZY ,optional=false) //remove optional=false to aggragate but leads to a side effect when going directly to the entity: required check is not performed=> if no set DB check constraint is raised...
    @JoinColumn(name="factura_venta_identificador", nullable=false,  unique=false  )
    @ReferenceView ("reference") 
    private FacturaVenta facturaVentaIdentificador; 
    
//MP-MANAGED-UPDATABLE-ENDING
//children
//m2m
    /**
    * Default constructor
    */
    public CobroFactura() {
    }


    public Integer getIdentificador() {
        return identificador;
    }
	
    public void setIdentificador (Integer identificador) {
        this.identificador =  identificador;
    }
    


    public Comprobante getComprobanteIdentificador () {  //
    	return comprobanteIdentificador;
    }
	
    public void setComprobanteIdentificador (Comprobante comprobanteIdentificador) {
    	this.comprobanteIdentificador = comprobanteIdentificador;//this.comprobanteIdentificador = comprobante;
    }
    public FacturaVenta getFacturaVentaIdentificador () {  //
    	return facturaVentaIdentificador;
    }
	
    public void setFacturaVentaIdentificador (FacturaVenta facturaVentaIdentificador) {
    	this.facturaVentaIdentificador = facturaVentaIdentificador;//this.facturaVentaIdentificador = facturaVenta;
    }




//MP-MANAGED-ADDED-AREA-BEGINNING @implementation@
//MP-MANAGED-ADDED-AREA-ENDING @implementation@

}
